package com.sim.contact.tool.contacts;

import android.provider.ContactsContract;

public class Email {
     private String address;
     private int type;
     public String getAddress() {
         return address;
     }
     public void setAddress(String address) {
         this.address = address;
     }
     public int getType() {
         return type;
     }
     public void setType(int t) {
         this.type = t;
     }
     
     public Email(String a, int t) {
         this.address = a;
         this.type = t;
     }
     
     /**
      * format 个人,xxx@xxx.com
      * @return
      */
     public String toString(){
     	String rslt="";
     	rslt+=getTypeName();
 		rslt+=":";
 		rslt+=(address==null?"":address);
     	
     	return rslt; 
     }
     
     private String getTypeName(){
     	String name="";
     	switch (type) {
 		case ContactsContract.CommonDataKinds.Email.TYPE_WORK:
 			name = "工作Email";
 			break;
 		case ContactsContract.CommonDataKinds.Email.TYPE_MOBILE:
 			name = "个人Email";
 			break;
 		default:
 			name = "其他Email";
 			break;
 		}
     	
     	return name;
     }
}